package com.cloud.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cloud.entity.SysProjectAuth;
import com.cloud.system.mapper.SysProjectAuthMapper;
import com.cloud.system.service.ISysProjectAuthService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 项目授权管理
 *
 * @author yzj
 * @since 2022-12-07
 */
@Service
public class SysProjectAuthServiceImpl extends ServiceImpl<SysProjectAuthMapper, SysProjectAuth> implements ISysProjectAuthService {

    @Resource
    private SysProjectAuthMapper sysProjectAuthMapper;

    /**
     * 分页项目授权
     *
     * @author yzj
     */
    @Override
    public List<SysProjectAuth> selectSysProjectAuthList(SysProjectAuth projectAuth) {
        return sysProjectAuthMapper.selectSysProjectAuthList(projectAuth);
    }

    /**
     * 新增项目授权
     *
     * @author yzj
     */
    @Override
    public int insertObject(SysProjectAuth projectAuth) {
        return sysProjectAuthMapper.insert(projectAuth);
    }

    /**
     * 修改项目授权
     *
     * @author yzj
     */
    @Override
    public int updateObject(SysProjectAuth projectAuth) {
        return sysProjectAuthMapper.updateById(projectAuth);
    }

    /**
     * 根据主键查询密钥信息
     *
     * @return
     */
    @Override
    public SysProjectAuth selectProjectAuthInfo(Long id) {
        return sysProjectAuthMapper.selectProjectAuthInfo(id);
    }

    /**
     * 根据类型查询密钥信息
     *
     * @return
     */
    @Override
    public SysProjectAuth selectApplyProjectAuth(SysProjectAuth projectAuth) {
        return sysProjectAuthMapper.selectApplyProjectAuth(projectAuth);
    }

}
